package com.example.hello.client.TabPanel;

import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.Connector;

import java.util.LinkedList;
import java.util.List;

public class BootstrapTabPanelState extends AbstractComponentState {

    private List<Connector> tabs = new LinkedList<Connector>();

    private int selectedTab;
    private String tabPosition;
    private boolean pullRight;

    public void addTab(Connector tab) {
        tabs.add(tab);
    }

    public void addTab(Connector tab, int index) {
        tabs.add(index, tab);
    }

    public boolean removeTab(Connector tab) {
        return tabs.remove(tab);
    }

    public boolean removeTab(int index) {
        return tabs.remove(tabs.get(index));
    }

    public List<Connector> getTabs() {
        return tabs;
    }

    public void setTabs(List<Connector> tabs) {
        this.tabs = tabs;
    }

    public int getSelectedTab() {
        return selectedTab;
    }

    public String getTabPosition() {
        return tabPosition;
    }

    public void setSelectedTab(int selectedTab) {
        this.selectedTab = selectedTab;
    }

    public void setTabPosition(String tabPosition) {
        this.tabPosition = tabPosition;
    }

    public boolean isPullRight() {
        return pullRight;
    }

    public void setPullRight(boolean pullRight) {
        this.pullRight = pullRight;
    }

}